In the field of oil and gas production, a surface facility network system may be represented as sets of nodes, connections between nodes, connections between nodes and reservoir grid cells (perforations), and connections between nodes and sinks (production) or sources (injection). An exemplary surface facility network with constraints is illustrated in FIG. 1.
A major difficulty in flow network calculations is determining which of the possible constraints are active. For example, there may be hundreds, or perhaps thousands, of constraints that interact in various ways. This most likely would make a simple trial and error approach prohibitively expensive, because each trial would require factoring the facility matrix. Moreover, certain constraints can be mutually incompatible. There cannot be two active rate constraints, for example, within a single flow line because this results in a singular matrix.
Different kinds of rate constraints can be applied to the connections such as, for example, QOSMAX, which is the maximum oil phase rate constraint at a surface condition. Likewise, different kinds of minimum/maximum pressure constraints (Pmin/Pmax) can be applied to the nodes. The rate constraint is typically enforced by a valve at the connection. The Pmin constraint at a node is enforced by a valve at the downstream connection of the node, and the Pmax constraint is enforced by a valve at the upstream connection of the node. If there is no constraint specified (or the constraint is inactive), a hydraulics equation may be applied at the connection to relate the fluid component rates and the end node pressures.
A set of equations must be set up to solve for the fluid component rates in connections and pressures at nodes. The equations are typically based on properties of the network and given constraints and may include:                (a) Fluid component mass balance equations at nodes.        (b) Connection equations at connections, which can be (i) a hydraulics equation, (ii) a rate constraint equation, (iii) a pressure constraint equation at the downstream connection of a node with Pmin constraint, or at the upstream connection of a node with Pmax constraint, or (iv) other kinds of constraints, such as separation/splitting constraint equations.        (c) Perforation equations at perforations.        
Equations (a) and (c) are fixed, while an algorithm is needed to choose only one of the possible connection equations for each connection at which there is more than one possible connection equation. The algorithm must decide which one of the possible connection equations should be chosen for a given connection, bearing in mind that an over-constrained network system cannot be solved and each connection can have only one connection equation. If the network system is over constrained, then a singular matrix of the system equations is created that can not be solved by the linear solver at a Newton step when the Newton method is used to solve the system of nonlinear equations of the network. The Newton method is one of the standard methods that can solve a system of nonlinear equations; it uses the solution of a set of linear equations, which is obtained based on the Taylor series expansion of the nonlinear equations to approximate the solution of the nonlinear equation. This linearization process may be repeated in multiple iterations until the solution converges. Each iteration is called a Newton step.
An exemplary section of an over-constrained surface-facility network is illustrated in FIG. 2. In this example, it is assumed that the fluid has only one component. The unknowns of the system are thus, q1, q2, and p2, which are the rate at Conn1, the rate at Conn2 and the pressure at Node2, respectively; while p1 (pressure at Node1) and p3 (pressure at Node3) are constants (p1=5000, p3=150). It is also assumed for this example, that the pressure drop between Node1 and Node3 is large enough that the two rate constraints will be violated when the valves at Conn1 and Conn2 are fully opened. The two rate constraint equations, which are chosen to be the connection equations at Conn1 and Conn2, and the mass balance equation at Node2 are, respectively:q1=1000,  (1)q2=2000,  (2)q1−q2=0,  (3)It is clear that the three equations are contradictory and cannot all be satisfied, and that the pressure at Node2 is undetermined since this pressure does not appear in any of the equations. If the unknowns are ordered as q1, q2, p2, then the system equation matrix becomes:
                              [                                                    1                                            0                                            0                                                                    0                                            1                                            0                                                                    1                                                              -                  1                                                            0                                              ]                ,                            (        4        )            which is singular and can not be solved.
The QMAX constraint at Conn2 may be removed, since its value is greater than the QMAX constraint at Conn1. In other words, the rate must be equal to or less than the smaller of the two QMAX constraints, which is QMAX=1000 at Conn1. The QMAX constraint at Conn2 (equation (2)) may be replaced by the hydraulics equation:−p2+p3+b2q2+c2=0,  (5)where b2 and c2 are constants determined by the hydraulics correlation. The network system can now be solved because the matrix of the equation system:
                              [                                                    1                                            0                                            0                                                                    0                                            1                                            0                                                                    1                                                              b                  2                                                                              -                  1                                                              ]                ,                            (        6        )            is not singular.
Nexus®, which is a commercial-reservoir-simulator application marketed by Landmark Graphics Corporation, typically models the reservoir and surface facility network system (including wells) in a fully coupled manner by heuristically eliminating extraneous constraints in the manner illustrated by FIG. 3 and FIG. 4 and therefore, can be just as expensive as other traditional methods of determining active constraints. FIG. 3 illustrates the overall workflow 300 of a Nexus® time-step simulation. The work flow 300 begins at the First Newton—also referred to as the top of the time step. In step 304, the standalone surface network model is solved with a fixed reservoir condition in the manner described more particularly in reference to FIG. 4. In step 306, the work flow 300 determines whether there is convergence of the standalone-surface-network model Newton steps. If there is no convergence, then the work flow 300 repeats the next Newton step at step 304. If there is convergence, then the work flow 300 solves the coupled reservoir/surface network model at step 308 and determines whether there is convergence of the standalone-surface-network model Newton steps at step 310. At step 312, the work flow 300 proceeds to the next time step.
A conventional method for solving the standalone-surface-network model at step 304 in FIG. 3 is illustrated by the method 400 in FIG. 4. The method 400 begins at the first Newton of the standalone-network solve and heuristically determines the active constraints by eliminating extraneous constraints. In step 404, the user specified network configuration and constraints are checked for any change at the current time step. If there is no change, then the method 400 proceeds to step 406; otherwise, the network is reinitialized at step 404(b) and then the method 400 proceeds to step 406.
In step 406, the values of fluid rates and node pressures at each current Newton step are compared with the constraint values to determine the violation factor of each constraint. In other words, each connection and node are analyzed to determine if there are any constraints violated and how much they are violated. The constraint with the largest violation factor at each connection and node is selected as an active constraint candidate.
In step 408, all extraneous constraints in the network are removed as active constraint candidates. All remaining constraints are active constraints. In FIG. 1, for example, the sum of the QOSMAX constraints in connections P-1 and P-2 is smaller than the QOSMAX constraint in Gather1. If the constraints in P-1 and P-2 are satisfied, which they must be, the constraint in Gather1 is automatically satisfied also. As a result, the constraint in Gather1 is extraneous and should be removed.
However, in a situation where connection Gather1 is separated from connection P-1 and connection P-2 by a complex network consisting of hundreds, or perhaps thousands, of connections, which may have different sorts of constraints themselves, this manner of checking logic can be prohibitively expensive and unreliable. It may, for example, miss some extraneous constraints, which results in a singular matrix, or it may remove some constraints that should be kept, which results in inaccurate solutions.
In step 410, the constraint equation is applied as the connection equation at each connection that has an active constraint. Otherwise, the hydraulics equation is applied as the connection equation. In step 412, the linearized network system equation(s) are solved using a well known linear solver. In step 414, the linear solver determines whether the network system equation(s) results in a singular matrix. If the matrix is singular, the method proceeds to step 420 and determines whether the network has been reinitialized. If the network has been reinitialized, then the method 400 aborts prematurely at step 422. If the network has not been reinitialized, then the method 400 repeats at step 404(b) and reinitializes the network. If the matrix, however, is not singular, then the method 400 determines whether convergence has occurred at step 416. If convergence has not occurred, then the method 400 repeats at step 406, which is the next Newton step. If convergence is achieved, then the method 400 proceeds to solve the coupled reservoir/surface network model at step 418.
When the method 400 is used, it uses the active constraint set determined by step 304 (with a fixed reservoir condition) to construct a network equation. However, it may result in a different set of active constraints from that of step 304 if the reservoir condition has changed, which means the network equations were incorrect. This will force one or more Newton steps.
Other well known and accepted methods for determining active constraints in a surface facility network may be equally expensive, unreliable and/or inefficient such as, for example, the optimization methods described in Practical Methods of Optimization, Second Edition, by R. Fletcher, Linear Programming, which requires the maximum value of certain objective functions to be calculated when constraints are applied.
Therefore, there is a need for a systematic approach to determine the active constraints in a surface-facility network that is more efficient and reliable than conventional means.